<?php if(!defined('PHPOK_SET')){die('<h3>Error...</h3>');}?><?php QG_C_TEMPLATE::p("global_head","","0");?>
<?php QG_C_TEMPLATE::p("right.css","","0");?>
<?php QG_C_TEMPLATE::p("right.head","","0");?>

<!-- 管理员管理 -->
<?php if($sysact == "add" || $sysact == "modify"){?>
<div class="table2">
	&nbsp;<a href="admin.php?file=index">系统首页</a> &raquo;
	<a href="admin.php?file=adminer&act=list">管理员列表</a> &raquo;
	<?php if($sysact == "add"){?>添加新管理员<?php }else{ ?>编辑管理员<?php } ?>
	<input type="button" value="管理员列表" onclick="qgurl('admin.php?file=adminer&act=list')">
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<?php if($sysact == "modify"){?>
<form name="qgform" id="qgform" method="post" action="<?php echo $r_url;?>modifyok&id=<?php echo $id;?>" onsubmit="return add_msg();">
<?php }else{ ?>
<form name="qgform" id="qgform" method="post" action="<?php echo $r_url;?>addok" onsubmit="return add_msg();">
<?php } ?>
<tr>
	<td class="left">账号：<span style="color:red;">*</span></td>
	<td class="right"><input type="text" name="username" id="username" value="<?php echo $rs[user];?>"></td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">密码：<span style="color:red;">*</span></td>
	<td class="right">
		<input type="text" name="password" id="password" value="<?php echo $rs[pass];?>">
		<?php if($sysact == "modify"){?>
		<span class="clue_on">[不修改密码请不要改动内容]</span>
		<?php }else{ ?>
		<span class="clue_on">[默认密码是123456]</span>
		<?php } ?>
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">管理员邮箱：</td>
	<td class="right"><input type="text" name="email" id="email" value="<?php echo $rs[email];?>"></td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">管理员类型：</td>
	<td class="right">
		<table cellpadding="1" cellspacing="0">
		<tr>
			<td><input type="radio" name="typer" value="system"<?php if($rs[typer] == "system"){?> checked<?php } ?>></td>
			<td>系统管理员</td>
			<td><input type="radio" name="typer" value="manager"<?php if($rs[typer] == "manager"){?> checked<?php } ?>></td>
			<td>站长管理员</td>
			<td><input type="radio" name="typer" value="editor"<?php if($rs[typer] != "manager" && $rs[typer] != "system"){?> checked<?php } ?>></td>
			<td>普通管理员</td>
			<td class="clue_on">[站长管理员及普通管理员需要针对以下模块权限进行设置]</td>
		</tr>
		</table>
	</td>
</tr>
</table>
</div>

<div class="table">
<table>
<tr>
	<td class="left">&nbsp;</td>
	<td class="right clue_on">部分权限仅限系统管理员才有：如管理员添加修改，数据库备份还原等</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">常用的模块权限：</td>
	<td class="right">
		<table cellpadding="1" cellspacing="0">
		<tr>
			<td><input type="checkbox" name="modulelist[]" value="sysset"<?php if($module[sysset]){?> checked<?php } ?>></td>
			<td>系统设置</td>
			<td><input type="checkbox" name="modulelist[]" value="users"<?php if($module[users]){?> checked<?php } ?>></td>
			<td>玩家管理</td>
			<td><input type="checkbox" name="modulelist[]" value="games"<?php if($module[games]){?> checked<?php } ?>></td>
			<td>游戏管理</td>
			<td><input type="checkbox" name="modulelist[]" value="qitas"<?php if($module[qitas]){?> checked<?php } ?>></td>
			<td>其他管理</td>
		</tr>
		<tr>
			<td><input type="checkbox" name="modulelist[]" value="shop"<?php if($module[shop]){?> checked<?php } ?>></td>
			<td>商业管理</td>
			<td><input type="checkbox" name="modulelist[]" value="zhifu"<?php if($module[zhifu]){?> checked<?php } ?>></td>
			<td>支付平台</td>
			<td><input type="checkbox" name="modulelist[]" value="shujuku"<?php if($module[shujuku]){?> checked<?php } ?>></td>
			<td>数据库管理</td>
		</tr>

		</table>
	</td>
</tr>
</table>
</div>


<?php $button_msg = $sysact == "modify" ? "编辑管理员" : "添加管理员";?>
<div class="table">
<table width="100%">
<tr>
	<td class="left">&nbsp;</td>
	<td class="right"><input type="submit" id="creat_button" class="mybutton_01" value="<?php echo $button_msg;?>"> &nbsp; <span id="show_step" style="color:red;"></span></td>
</tr>
</form>
</table>
</div>
<script type="text/javascript">
function add_msg(msg)
{
	var username = $("username").value;
	if(!username)
	{
		alert("管理员名称不允许为空");
		return false;
	}

	$("show_step").innerHTML = "<img src='admin/tpl/images/loading.gif' border='0' align='absmiddle'> 正在保存数据，如果网页没有动静请刷新...";
	$("creat_button").disabled = true;
}
</script>

<?php }elseif($sysact == "list"){ ?>
<div class="table2">
	&nbsp;<a href="admin.php?file=index">系统首页</a> &raquo;
	<a href="admin.php?file=adminer&act=list">管理员列表</a> &raquo;
	<input type="button" value="添加管理员" onclick="qgurl('admin.php?file=adminer&act=add')">
</div>


<?php $_i=0;$rslist=(is_array($rslist))?$rslist:array();foreach($rslist AS  $key=>$value){$_i++; ?>
<div id="user_<?php echo $value[id];?>" class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
	<td style="text-align:left;width:40%">&nbsp;<?php echo $value[user];?></td>
	<td style="text-align:left;width:40%">&nbsp;<?php if($value[typer]=="system"){?>系统管理员<?php }elseif($value[typer]=="manager"){ ?>站长管理员<?php }elseif($value[typer]=="editor"){ ?>普通管理员<?php } ?></a></td>
	<td style="text-align:right;width:20%;height:23px;">
		<input type="button" value="编辑" class="mybutton_01" onclick="qg_modify(<?php echo $value[id];?>)">
		<input type="button" value="删除" class="mybutton_01" onclick="qg_delete(<?php echo $value[id];?>)">
	</td>
</tr>
</table>
</div>
<?php } ?>

<script type="text/javascript">
function qg_modify(id)
{
	qgurl("admin.php?file=adminer&act=modify&id="+id);
}
function qg_delete(id)
{
	//判断是否删除
	question = confirm("确认删除该信息吗？特别说明，删除后无法恢复！");
	if (question != "0")
	{
		qgurl("admin.php?file=adminer&act=delete&id="+id);
	}
}
</script>
<?php } ?>
<?php QG_C_TEMPLATE::p("foot","","0");?>